package com.hyt.it.ogt.kq.service.bm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hyt.it.ogt.kq.service.bm.model.entity.ProjectSubject;
import com.hyt.it.ogt.kq.service.bm.model.entity.StudentSubject;
import com.hyt.it.ogt.kq.service.bm.model.vo.StudentInfoParam;
import com.hyt.it.ogt.kq.service.bm.model.vo.StudentListVo;
import com.hyt.it.ogt.kq.service.bm.model.vo.StudentSubjectDetailVo;
import com.hyt.it.ogt.kq.service.bm.model.vo.SubjectStatVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 报名项目科目 Mapper 接口
 * </p>
 *
 * @author wangt
 * @since 2020-05-15
 */
public interface ProjectSubjectMapper extends BaseMapper<ProjectSubject> {

    List<ProjectSubject> getSubjectList(@Param("projectId") String projectId, @Param("regId") String regId, @Param("status") String status);

    String getStudentId(@Param("regId") String regId, @Param("projectId") String projectId);

    boolean deleteBy(@Param("studentId") String studentId, @Param("projectId") String projectId, @Param("subjectId") String subjectId);

    IPage<StudentListVo> getStudentList(@Param("param") StudentInfoParam param);

    List<SubjectStatVo> statSubjectByProjectId(@Param("projectId") String projectId, @Param("permissionList") List<String> permissionList, @Param("subjectId") String subjectId,
                                               @Param("deptId") String deptId);

    long getStudentListCount(@Param("queryStr") String queryStr, @Param("projectId") String projectId, @Param("auditState") String auditState);

    void deleteStudent(@Param("studentId") String studentId);

    void deleteStudentSubject(@Param("studentId") String studentId, @Param("subjectId") String subjectId);

    List<StudentSubject> getSubjectByStudentId(@Param("projectId") String projectId, @Param("studentId") String studentId);

    void updateStudentAudit(@Param("studentId") String studentId, @Param("projectId") String projectId);

    String getSqlColumn(@Param("projectId") String projectId);

    /***
     * 获取报名项目全量的采集信息
     *
     * @param projectId
     * @return
     */
    String getTitleSqlColumn(
            @Param("projectId") String projectId
    );

    /***
     * 获取报名项目基础的采集信息
     *
     * @param projectId
     * @return
     */
    String getBaseInfoTitleSqlColumn(
            @Param("projectId") String projectId
    );

    String getBaseCjSqlColumn(
            @Param("projectId") String projectId
    );

    List<Map<String, Object>> getAllList(
            @Param("studentInfoParam") StudentInfoParam studentInfoParam
    );
    
    List<Map<String, Object>> getAllListNoSubject(
            @Param("studentInfoParam") StudentInfoParam studentInfoParam
    );

    List<Map<String, Object>> queryAllStudent(
            @Param("columns") String columns,
            @Param("projectId") String projectId,
            @Param("studentId") String studentId,
            @Param("isPay") String isPay,
            @Param("isAudit") String isAudit);

    List<Map<String, Object>> queryStudentById(
            @Param("columns") String columns,
            @Param("projectId") String projectId,
            @Param("studentId") String studentId);

    List<Map<String, Object>> getAllSubjectList(
            @Param("columns") String columns,
            @Param("projectId") String projectId,
            @Param("permissionList") List<String> permissionList,
            @Param("subjectId") String subjectId,
            @Param("keyWord") String keyWord);

    List<Map<String, String>> getSubjectListByProjcetId(@Param("enrollId") String enrollId, @Param("subjectId") String subjectId);

    List<StudentSubjectDetailVo> getProjectSubjectByStuId(@Param("projectId") String projectId, @Param("studentId") String studentId);

    void updateProject(ProjectSubject projectSubject);

    ProjectSubject querySubject(@Param("id") String id);

    ProjectSubject queryBySubjectId(@Param("projectId") String projectId, @Param("subjectId") String subjectId);

    List<ProjectSubject> querySubjectList(@Param("projectId") String projectId, @Param("subjectName") String subjectName);

    ProjectSubject querySubjectByProjectId(@Param("projectId") String projectId, @Param("subjectId") String subjectId);
    
    ProjectSubject querySubjectByName(@Param("projectId") String projectId, @Param("subjectName") String subjectName);

    String getPayStatusById(@Param("studentId") String studentId, @Param("subjectId") String subjectId);

    String getResultByStudent(@Param("projectId") String projectId, @Param("studentId") String studentId);

    List<Map<String, Object>> queryAllStudentByPage(
            @Param("columns") String columns,
            @Param("projectId") String projectId,
            @Param("studentId") String studentId,
            @Param("isPay") String isPay,
            @Param("isAudit") String isAudit,
            @Param("current") int current,
            @Param("size") int size);

    IPage<StudentListVo> getStudentListV2(@Param("param") StudentInfoParam param);
}
